package thinkinjava4.ch18_io;

import thinkinjava4.util.Directory;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * 使用available方法查看还有多少可供存取的字符
 */
public class TestEOF {
    public static void main(String[] args) throws IOException {
        DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(Directory.BASE_DIR + "TestEOF.java")));
        while (in.available() != 0) System.out.print((char) in.readByte());
    }
}
